<tagLib name="html" />
<div id="main-content">
    <div id="main" class="main">
        <!-- 修改密码 start -->
        <div class="spin-cont">
            <div class="user-hd">
                <h2>{$page_title}</h2>
            </div>
            <div class="user_zl">
                <form name="data_form" id="data_form" method="POST">
                <dl class="clearfix">
                    <dt>角色名称：</dt>
                    <dd><input type="text" id="group_name" name="group_name" value="{$model.group_name}" maxlength="12" class="bg-input w229"/></dd>
                    <dd class="error_message" id="message_group_name"></dd>
                    <dd class="field_info" id="message_group_name_info">请输入1-12位中文、英文、数字、下划线</dd>
                </dl>
                <dl class="clearfix">
                    <dt>角色描述：</dt>
                    <dd><textarea id="description" name="description" class="bg-textarea w229" maxlength="50">{$model.description}</textarea></dd>
                    <dd class="error_message" id="message_description"></dd>
                    <dd class="field_info" id="message_description_info">请输入1-50个字符</dd>
                </dl>
                <dl class="clearfix hidden">
                    <dt>前台是否登录：</dt>
                    <dd>
                        <html:select options="yes_no_options" name="is_front_login" selected="model[is_front_login]" />
                    </dd>
                </dl>
                <dl class="clearfix">
                    <dt>角色权限：</dt>
                    <dd class="permission_list">
                        <volist name="menu_list" id="vo">
                            <?php if('' == $vo[name_pre])$level_1_id = $vo['menu_id'];?>
                            <if condition="('' EQ $vo[name_pre]) OR ('|—' EQ $vo[name_pre])"><div class="clear"></div></if>
                            <div class="<if condition="'' EQ $vo[name_pre]">level_1</if> <if condition="'|—' EQ $vo[name_pre]">level_2</if> <if condition="'|——' EQ $vo[name_pre]">level_3</if>  <if condition="19 EQ $vo[menu_id]">hidden</if>">
                                <label>
                                    <input type="checkbox" name="menu_ids[]" <if condition="'' EQ $vo[name_pre]">onclick="checkMainMenu(this, {$vo.menu_id})"</if> <if condition="in_array($vo[menu_id], $model[menu_ids]) OR (19 EQ $vo[menu_id])">checked="checked"</if> value="{$vo.menu_id}" class="menu_ids parent_id_{$vo.parent_id} <if condition="'' NEQ $vo[name_pre]">level_1_id_{$level_1_id}</if>" />
                                    <span>{$vo.name}</span>
                                </label>
                            </div>
                        </volist>
                    </dd>
                </dl>
                <dl class="clearfix">
                    <dt></dt>
                    <dd>
                        <a href="javascript:;" class="gray-btn" id="submit_btn" onclick="saveUserGroup()">确定</a>
                        <a href="javascript:;" class="gray-btn" onclick="reset('data_form')">取消</a>
                        <input type="hidden" name="group_id" value="{$group_id}" />
                    </dd>
                </dl>
                </form>
            </div>
        </div>
    </div>
</div>
<script>
    $(function(){
        $(".menu_ids").change(function() {
            checkSubMenu(this);
        });
    }); 
</script>